<layout name='Layout/layout_main' />
<tagLib name="html" />
<script type="text/javascript" src="__PUBLIC__/editor/kindeditor.js"></script>
<script type="text/javascript" src="__PUBLIC__/editor/kindeditor.setting.js"></script>
<script type="text/javascript">
	function save() {
		$("#confirm").val("");
		$("#confirm_wrap  span.address_list span").each(function() {
			$("#confirm").val($("#confirm").val() + $(this).attr("emp_no") + '|');
		})

		$("#confirm_name").val("");
		$("#confirm_name").val($("#confirm_wrap span.address_list").html());

		$("#consult").val("");
		$("#consult_wrap span.address_list span").each(function() {
			$("#consult").val($("#consult").val() + $(this).attr("emp_no") + '|');
		})

		$("#consult_name").val("");
		$("#consult_name").val($("#consult_wrap span.address_list").html());

		$("#refer").val("");
		$("#refer_wrap span.address_list span").each(function() {
			$("#refer").val($("#refer").val() + $(this).attr("emp_no") + '|');
		})

		$("#refer_name").val("");
		$("#refer_name").val($("#refer_wrap span.address_list").html());

		editor.sync();
		if (check_form("form_data")) {
			sendForm("form_data", "{:U('save')}", "{:U('edit?id='.$vo['id'])}");
		}
	}

	function popup_flow() {
		winopen("{:U('popup/flow')}", 730, 574);
	}


	$(document).ready(function() {
		editor_init();
		set_val("is_del", "{$vo.is_del}");
		set_val("group", "{$vo.group}");
		set_val("type", "{$vo.type}");
	})
</script>
<div class="title panel panel-default">
	<div class="panel-body">
		<h3 class="col-md-12">编辑流程:{$vo.name}</h3>
	</div>
</div>
<form method='post' id="form_data" class="well form-horizontal">
	<input type="hidden" id="id" name="id" value="{$vo.id}">
	<input type="hidden" id="opmode" name="opmode" value="edit">
	<input type="hidden" id="ajax" name="ajax" value="1">
	<input type="hidden" id="confirm" name="confirm" >
	<input type="hidden" id="confirm_name" name="confirm_name" >
	<input type="hidden" id="consult" name="consult" >
	<input type="hidden" id="consult_name" name="consult_name">
	<input type="hidden" id="refer" name="refer">
	<input type="hidden" id="refer_name" name="refer_name" >

	<div class="form-group col-md-6">
		<label class="col-md-4 control-label" for="name">名称*：</label>
		<div class="col-md-8">
			<input  value="{$vo.name}" class="form-control" type="text" id="name" name="name" check="require" msg="请输入姓名">
		</div>
	</div>

	<div class="form-group col-md-6">
		<label class="col-md-4 control-label" for="short">简称*：</label>
		<div class="col-md-8">
			<input   value="{$vo.short}" class="form-control" type="text" id="short" name="short" check="require" msg="请输入姓名">
		</div>
	</div>

	<div class="form-group col-md-6">
		<label class="col-md-4 control-label" for="doc_no_format">编码格式*：</label>
		<div class="col-md-8">
			<input value="{$vo.doc_no_format}" class="form-control" type="text" id="doc_no_format" name="doc_no_format" check="require" msg="请输入姓名">
		</div>
	</div>

	<div class="form-group col-md-6">
		<label class="col-md-4 control-label" for="group">分组：</label>
		<div class="col-md-8">
			<select name="group" id="group" class="form-control" msg="请选择职级" check="require">
				<option>选择或录入</option>
				{:fill_option($group_list)}
			</select>
		</div>
	</div>

	<div class="form-group col-md-6">
		<label class="col-md-4 control-label" for="sort">排序：</label>
		<div class="col-md-8">
			<input class="form-control" type="text" id="sort" name="sort" value="{$vo.sort}">
		</div>
	</div>

	<div class="form-group col-md-6">
		<label class="col-md-4 control-label" for="is_del">状态：</label>
		<div class="col-md-8">
			<select class="form-control" name="is_del" id="is_del">
				<option value="0" >启用</option>
				<option value="1">禁用</option>
			</select>
		</div>
	</div>
	<div class="clearfix"></div>
	<div class="form-group">
		<div class="col-md-12">
			<textarea id="content" name="content" style="width:100%;height:300px;">{$vo.content}</textarea>
		</div>
	</div>

	<div class="form-group col-md-12">
		<label class="col-md-2 control-label" for="type">流程类型：</label>
		<div class="col-md-10">
			<select class="form-control col-10" name="type" id="type" type="select-one">
				<option value="0" >自由</option>
				<option value="1">固定</option>
			</select>
		</div>
	</div>
	<div class="form-group col-md-12">
		<label class="col-md-2 control-label" for="type">裁决步骤：</label>
		<div class="col-md-10">
			<div id="confirm_wrap" class="inputbox">
				<a class="pull-right btn btn-link text-center" onclick="popup_flow();"> <i class="icon-user"></i> </a>
				<div class="wrap" >
					<span class="address_list">{$vo.confirm_name}</span>
					<span class="text" >
						<input class="letter" type="text"  >
					</span>
				</div>
				<div class="search dropdown ">
					<ul class="dropdown-menu"></ul>
				</div>
			</div>
		</div>
	</div>

	<div class="form-group col-md-12">
		<label class="col-md-2 control-label" for="type">协商步骤：</label>
		<div class="col-md-10">
			<div id="consult_wrap" class="inputbox">
				<a class="pull-right btn btn-link text-center" onclick="popup_flow();"> <i class="icon-user"></i> </a>
				<div class="wrap" >
					<span class="address_list">{$vo.consult_name}</span>
					<span class="text" >
						<input class="letter" type="text"  >
					</span>
				</div>
				<div class="search dropdown">
					<ul class="dropdown-menu"></ul>
				</div>
			</div>
		</div>
	</div>

	<div class="form-group col-md-12">
		<label class="col-md-2 control-label" for="type">抄送：</label>
		<div class="col-md-10">
			<div id="refer_wrap" class="inputbox">
				<a class="pull-right btn btn-link text-center" onclick="popup_flow();"> <i class="icon-user"></i> </a>
				<div class="wrap" >
					<span class="address_list">{$vo.refer_name}</span>
					<span class="text" >
						<input class="letter" type="text"  >
					</span>
				</div>
				<div class="search dropdown ">
					<ul class="dropdown-menu"></ul>
				</div>
			</div>
		</div>
	</div>

	<div class="action">
		<input class="btn btn-default" type="button" value="保存" onclick="save();">
		<input  class="btn btn-default" type="button" value="取消" onclick="go_return_url();">
	</div>
</form>